const Mock = require('mockjs');

const mockFiles = require.context('./modules/', false, /^.*\.js$/);
const mocks = [];
mockFiles.keys().forEach(fileName => {
  if (fileName !== './index.js') {
    const item = mockFiles(fileName);
    mocks.push(...item.default);
  }
});

mocks.forEach(item => {
    Mock.mock(item.url, item.type, item.response);
})
